home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / demo / medit.zip / MULTIPAD.CPP < prev    next >
C/C++ Source or Header  |  1994-08-29  |  2KB  |  69 lines

  1. // multipad.cpp : Defines the class behaviors for the Multipad application.
  2. //
  3. // This is a part of the Microsoft Foundation Classes C++ library.
  4. // Copyright (C) 1992 Microsoft Corporation
  5. // All rights reserved.
  6. //
  7. // This source code is only intended as a supplement to the
  8. // Microsoft Foundation Classes Reference and Microsoft
  9. // QuickHelp and/or WinHelp documentation provided with the library.
  10. // See these sources for detailed information regarding the
  11. // Microsoft Foundation Classes product.
  12.  
  13. #include "stdafx.h"
  14. #include "magmaed.hpp"
  15. #include "mainfrm.h"
  16. #include "multipad.h"
  17.  
  18. #define USE_MAGMA
  19.  
  20. CMultiPadApp NEAR theApp;
  21.  
  22. BEGIN_MESSAGE_MAP(CMultiPadApp, CWinApp)
  23.     //{{AFX_MSG_MAP(CMultiPadApp)
  24.     ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  25.     //}}AFX_MSG_MAP
  26.     ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)     // file commands...
  27.     ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  28.     ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  29. END_MESSAGE_MAP()
  30.  
  31. BOOL CMultiPadApp::InitInstance()
  32. {
  33. #ifdef USE_VBX
  34.     EnableVBX();   // required for VBX support
  35. #endif
  36.  
  37.     SetDialogBkColor();
  38.     LoadStdProfileSettings();
  39.     AddDocTemplate(new CMultiDocTemplate(IDR_TEXTTYPE,
  40.         RUNTIME_CLASS(CPadDoc), RUNTIME_CLASS(CMDIChildWnd),
  41. #ifdef USE_MAGMA
  42.           RUNTIME_CLASS(CMagmaEditView)));
  43. #else
  44.         RUNTIME_CLASS(CEditView)));
  45. #endif
  46.     m_pMainWnd = new CMainFrame;
  47.     ((CFrameWnd*)m_pMainWnd)->LoadFrame(IDR_MAINFRAME);
  48.     m_pMainWnd->ShowWindow(m_nCmdShow);
  49.  
  50.     // enable file manager drag/drop and DDE Execute open
  51.     m_pMainWnd->DragAcceptFiles();
  52.     EnableShellOpen();
  53.     RegisterShellFileTypes();
  54.  
  55.     if (m_lpCmdLine[0] == 0)
  56.         OnFileNew();
  57.     else
  58.         OpenDocumentFile(m_lpCmdLine);
  59.     return TRUE;
  60. }
  61.  
  62. void CMultiPadApp::OnAppAbout()
  63. {
  64.   CDialog(IDD_ABOUTBOX).DoModal();
  65. }
  66.  
  67. /////////////////////////////////////////////////////////////////////////////
  68.  
  69.